﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Young3.FMSearch.Core.Entities.InGame;

namespace Young3.FMSearch.Core.Entities.InGame
{
    public static partial class PositionalRatings
    {
        private static Func<PlayerSkills, decimal> __dmRatings = null;
        public static Func<PlayerSkills, decimal> DMRatings
        {
            get
            {
                if (__dmRatings == null)
                {
                    __dmRatings = (p) =>
                        (Convert.ToDecimal(
                        p.Crossing*10+
                        p.Dribbling*20+
                        p.Finishing*10+
                        p.FirstTouch*20+
                        p.Heading*20+
                        p.Marking*20+
                        p.Passing*60+
                        p.Tackling*100+
                        p.Technique*40+

                        p.Aggression*20+
                        p.Anticipation*60+
                        p.Bravery*20+
                        p.Composure*30+
                        p.Concentration*20+
                        p.Creativity*40+
                        p.Decisions*40+
                        p.Influence*10+
                        p.OffTheBall*20+
                        p.Positioning*80+
                        p.Teamwork*30+
                        p.Workrate*80+

                        p.Acceleration*70+
                        p.Agility*30+
                        p.Balance*20+
                        p.Jumping*20+
                        p.Pace*70+
                        p.Stamina*80+
                        p.Strength*60
                        )
                        / Convert.ToDecimal((10+20+10+20+20+20+60+100+40+20+60+20+30+20+40+40+10+20+80+
                        30+80+70+30+20+20+70+80+60) * 100));
                }
                return __dmRatings;
            }
        }
    }
}
